<?php

require_once 'BluesCoders/Event/Dispatcher.php';
require_once 'BluesCoders/Application/Event.php';
require_once 'BluesCoders/Event/Listener.php';

/**
 * Description of Standart
 *
 * @author miho
 */
class BluesCoders_Router_Standart {

    protected $_routes;

    public function setRoutes($value) {
        $this->_routes = $value;
    }

    public function route($uri) {
        foreach($this->_routes as $controllerId => $route) {
            if($route->match($uri)){
                $route->setControllerId($controllerId);
                return $route;
            }
        }
        //return array_shift(array_keys($this->_routes));
        throw new Exception("Uri ".$uri." does not mapped to any controller");
    }



}
?>
